package com.tjsinfo.tjsoa.Dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.LogicalExpression;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.SimpleExpression;

import com.tjsinfo.tjsoa.common.PaginationSupport;

public interface IQbcDao {

	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.system.TjsUser.ITjsUserDAO#getLogicalExpression(org.hibernate.criterion.LogicalExpression)
	 */
	public abstract List getCriteria(DetachedCriteria criteria);
	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.QBC.IQbcDao#getLogicalExpression(org.hibernate.criterion.LogicalExpression)
	 */
	public abstract List getLogicalExpression(Class class1,LogicalExpression expression);

	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.system.TjsUser.ITjsUserDAO#getSimpleExpression(org.hibernate.criterion.SimpleExpression)
	 */
	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.QBC.IQbcDao#getSimpleExpression(org.hibernate.criterion.SimpleExpression)
	 */
	public abstract List getSimpleExpression(Class class1,SimpleExpression expression);

	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.QBC.IQbcDao#getOneFuHeLogicalExpression(java.lang.Class, java.lang.String, org.hibernate.criterion.LogicalExpression)
	 */
	public abstract List getOneFuHeLogicalExpression(Class zhuclass,
			String fuclass, LogicalExpression expression);

	public abstract List getOneFuHeLogicalExpression(Class zhuclass,
			LogicalExpression expression, String fuclass,
			LogicalExpression expression1);

	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.QBC.IQbcDao#getOneFuHeSimpleExpressio(java.lang.Class, java.lang.String, org.hibernate.criterion.SimpleExpression)
	 */
	public abstract List getOneFuHeSimpleExpressio(Class zhuclass,
			String fuclass, SimpleExpression expression);

	public abstract List getOneFuHeSimpleExpressio(Class zhuclass,
			SimpleExpression expression, String fuclass,
			SimpleExpression expression1);

	/* (non-Javadoc)
	 * @see com.tjsinfo.tjsoa.QBC.IQbcDao#getTwoFuHeLogicalExpression(java.lang.Class, java.lang.String, org.hibernate.criterion.LogicalExpression, java.lang.String, org.hibernate.criterion.LogicalExpression)
	 */
	public abstract List getTwoFuHeLogicalExpression(Class zhuclass,
			String fuclass1, LogicalExpression expression1, String fuclass2,
			LogicalExpression expression2);

	public abstract List getTwoFuHeLogicalExpression(Class zhuclass,
			LogicalExpression expression, String fuclass1,
			LogicalExpression expression1, String fuclass2,
			LogicalExpression expression2);

	/**
	 * 
	 * @获得符合条件的记录数量
	 * @param criteria
	 *            所有查询条件
	 * @param propertyName
	 *            查询对象的主键
	 * @return Integer
	 * 			  符合条件的数据统计
	 * 
	 */
	public int getQueryNumber(DetachedCriteria criteria,String propertyName);
	
	
	/**
	 * 
	 * @获得分页后的记录数组,不可排序
	 * @param criteria
	 *            所有查询条件
	 * @param pageSize
	 * 				当前要分页的结果集步长
	 * @param startIndex
	 * 				当前分页结果在所有结果中的开始序号
	 * @return PaginationSupport
	 * 				符合条件的数据
	 * 
	 */
	
	public PaginationSupport findPageByCriteria(final DetachedCriteria detachedCriteria,final int pageSize,final int startIndex);
	
	
	/**
	 * 
	 * @获得分页后的记录数组，可排序
	 * @param criteria
	 *            所有查询条件
	 * @param pageSize
	 * 				当前要分页的结果集步长
	 * @param startIndex
	 * 				当前分页结果在所有结果中的开始序号
	 * @param orderList
	 * 				所需排序条件的集合
	 * @return PaginationSupport
	 * 				符合条件的数据
	 * 
	 */
	public PaginationSupport findPageByCriteria(final DetachedCriteria detachedCriteria,final List<Order> orderList,final int pageSize,final int startIndex);

	public Object getObjectById(Class zhuclass,Object id);
	
	public Integer save(Object object);
	public void update(Object object);
	public void delete(Object object);
	public void saveObject(Object object);
}